home *** CD-ROM | disk | FTP | other *** search
- Function CorrectConfigFile()
- On Error Resume Next
-
- configFileName = Session.Property("CustomActionData")
-
- Set doc = CreateObject("Msxml2.DOMDocument.4.0")
- If Err.Number <> 0 Then
- MsgBox "Could not create XML Document object."
- Exit Function
- End If
-
- doc.Load configFileName
- Set configurationNode = doc.SelectSingleNode("/configuration")
-
- ' Check to make sure that configSections is the first child node of configuration
- Set firstNode = configurationNode.FirstChild
- If firstNode.Text <> "configSections" Then
- ' If not, move the configSectionsNode to the beginning.
- Set configSectionsNode = configurationNode.SelectSingleNode("configSections")
- configurationNode.RemoveChild configSectionsNode
- configurationNode.InsertBefore configSectionsNode, configurationNode.FirstChild
-
- doc.Save configFileName
- End If
-
- If Err.Number <> 0 Then
- MsgBox "Error # " & CStr(Err.Number) & " " & Err.Description
- End If
- End Function
-